javascript numbers

integer precision

integer (numbers without a exponant notation) are accurate up to 15 digit. and maximum number in decimals is 17 digit

floating point arithmetic is also always not 100% accurate

solving problem above

but it helps to multiply and divide

adding numbers and strings

if you add 2 numeric string than the result will be concatenated string

if you add a numeric and a string than the result will be concatenated string

NaN - Not a Number

if a number is divided by a non numeric string than it becomes NaN(Not a Number)

if a number is divided by a numeric string than it becomes a Number

you can use the global javascript function isNaN() to find out if a value is not a number

the typeof NaN is number:

infinity is returned if you calculate a number outside the largest possible number: